package com.dj.common;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable {
    //    操作结果编码
    private Integer code;
    //    操作数据结果
    private Object data;
    //    消息
    private String message;

    //只返回数据
    public Result(Object data) {
        this.data = data;
    }
    //只返回消息
    public Result(String message) {
        this.message = message;
    }
    //返回编码和数据
    public Result(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }
    //返回编码,数据,信息
    public Result(Integer code, Object data, String message) {
        this.code = code;
        this.data = data;
        this.message = message;
    }
}
